package com.bluej.study.spring_boot.controller;

import com.bluej.study.spring_boot.entity.Bluej;
import com.bluej.study.spring_boot.entity.ConfigBean;
import com.bluej.study.spring_boot.rpc.RpcResult;
import com.bluej.study.spring_boot.util.PropertyUtil;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author xingdongjie
 * @date 2018/4/16 17:45
 */
@RestController
@RequestMapping("/hello")
public class HelloController {
    private Logger log = LoggerFactory.getLogger(this.getClass());

    @Autowired
    private PropertyUtil propertyUtil;
    @Autowired
    private Bluej bluej;
    @Autowired
    private ConfigBean configBean;

    @ApiOperation(value = "sayHello接口" , notes = "whate is notes",response = RpcResult.class)
    @ApiImplicitParam(name = "id",value = "用户编号",required = false,dataType = "Long")
    @RequestMapping(value = "/sayHello",method = RequestMethod.GET)
    public RpcResult sayHello(Long id){
        System.out.println("propertyUtil:"+propertyUtil.getTitle()+"_"+propertyUtil.getDescription());
        System.out.println("中文----adev");
        System.out.println("ab地方d");
        log.debug("--debug--");
        log.info("--info--");
        log.error("--error--");

        log.info("configBean:"+configBean);
        return new RpcResult(bluej);
    }
}
